package com.yh.filesystem.controller;

import com.lxw.api.filesystem.FileSystemControllerApi;
import com.lxw.framework.domain.filesystem.response.UploadFileResult;
import com.yh.filesystem.service.FilesystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @AUTHOR: yadong
 * @DATE: 2021/7/19 15:33
 * @DESC:
 */
@RestController
@RequestMapping("/filesystem")
public class FileSystemController implements FileSystemControllerApi {

    @Autowired
    private FilesystemService filesystemService;

    @Override
    @PostMapping("/upload")
    public UploadFileResult uploadFile(MultipartFile file, String businesskey, String filetag, String metadata) {
        return filesystemService.uploadFile(file,businesskey,filetag,metadata);
    }
}
